﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace JeanFish.UnitTest.Core
{
    [TestClass]
    public class ExtendedArrayTest
    {
        
        [TestMethod]
        public void ExtendedArrayConstructorTest()
        {
            string souceString="This is a test array.";
            char[] souce =souceString.ToCharArray();
            ExtendedArray<char> extendedArray = new ExtendedArray<char>(souce, 5, 4);
            extendedArray[0] = 'I';
            extendedArray[2]='-';
            string expected="This Is-a test array.";
            Assert.AreEqual(expected, string.Join("",souce));

            ExtendedArray<char> extendedArray2 = new ExtendedArray<char>(extendedArray, 3, 1);
            extendedArray2[0] = 'A';
            string expected2 = "This Is-A test array.";
            Assert.AreEqual(expected2, string.Join("", souce));
        }
    }
}
